package com.ruoyi.web.tdmdata.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.tdmdata.mapper.TdmZhongYaoFangJiMapper;
import com.ruoyi.web.tdmdata.domain.TdmZhongYaoFangJi;
import com.ruoyi.web.tdmdata.service.ITdmZhongYaoFangJiService;

/**
 * 中药方剂Service业务层处理
 * 
 * @author ly
 * @date 2022-03-14
 */
@Service
public class TdmZhongYaoFangJiServiceImpl implements ITdmZhongYaoFangJiService 
{
    @Autowired
    private TdmZhongYaoFangJiMapper tdmZhongYaoFangJiMapper;

    /**
     * 查询中药方剂
     * 
     * @param id 中药方剂主键
     * @return 中药方剂
     */
    @Override
    public TdmZhongYaoFangJi selectTdmZhongYaoFangJiById(Long id)
    {
        return tdmZhongYaoFangJiMapper.selectTdmZhongYaoFangJiById(id);
    }

    /**
     * 查询中药方剂列表
     * 
     * @param tdmZhongYaoFangJi 中药方剂
     * @return 中药方剂
     */
    @Override
    public List<TdmZhongYaoFangJi> selectTdmZhongYaoFangJiList(TdmZhongYaoFangJi tdmZhongYaoFangJi)
    {
        return tdmZhongYaoFangJiMapper.selectTdmZhongYaoFangJiList(tdmZhongYaoFangJi);
    }

    /**
     * 新增中药方剂
     * 
     * @param tdmZhongYaoFangJi 中药方剂
     * @return 结果
     */
    @Override
    public int insertTdmZhongYaoFangJi(TdmZhongYaoFangJi tdmZhongYaoFangJi)
    {
        tdmZhongYaoFangJi.setCreateTime(DateUtils.getNowDate());
        return tdmZhongYaoFangJiMapper.insertTdmZhongYaoFangJi(tdmZhongYaoFangJi);
    }

    /**
     * 修改中药方剂
     * 
     * @param tdmZhongYaoFangJi 中药方剂
     * @return 结果
     */
    @Override
    public int updateTdmZhongYaoFangJi(TdmZhongYaoFangJi tdmZhongYaoFangJi)
    {
        tdmZhongYaoFangJi.setUpdateTime(DateUtils.getNowDate());
        return tdmZhongYaoFangJiMapper.updateTdmZhongYaoFangJi(tdmZhongYaoFangJi);
    }

    /**
     * 批量删除中药方剂
     * 
     * @param ids 需要删除的中药方剂主键
     * @return 结果
     */
    @Override
    public int deleteTdmZhongYaoFangJiByIds(Long[] ids)
    {
        return tdmZhongYaoFangJiMapper.deleteTdmZhongYaoFangJiByIds(ids);
    }

    /**
     * 删除中药方剂信息
     * 
     * @param id 中药方剂主键
     * @return 结果
     */
    @Override
    public int deleteTdmZhongYaoFangJiById(Long id)
    {
        return tdmZhongYaoFangJiMapper.deleteTdmZhongYaoFangJiById(id);
    }
}
